package com.demo.study.config;

import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @author sz
 * @version V1.0
 * @date 2024/2/6 9:21
 * @Description: 多敲代码
 */
@Configuration
@Component
public class MyApplicationListener  implements ApplicationListener {

    @Override
    public void onApplicationEvent(ApplicationEvent applicationEvent) {
        //org.springframework.cloud.client.discovery.event.HeartbeatEvent
        //org.springframework.boot.builder.ParentContextApplicationContextInitializer$ParentContextAvailableEvent
        //org.springframework.boot.context.event.ApplicationPreparedEvent
        //org.springframework.context.event.ContextRefreshedEvent
        //org.springframework.boot.web.servlet.context.ServletWebServerInitializedEvent
        //org.springframework.cloud.client.discovery.event.InstancePreRegisteredEvent
        System.out.println("spring的内置Event+***"+applicationEvent.getClass().getName());
    }
}
